package com.jxb.ractBase;

import java.time.Duration;
import java.util.concurrent.TimeUnit;

import reactor.core.publisher.Flux;

/**
 * 类注释
 *
 * @author jiaobo
 * @date Created in 2024/10/23 21:13
 **/
public class ConcatTest {

    public static void main(String[] args) throws InterruptedException {
        // Flux<Integer> just1 = Flux.just(1, 2, 3, 4, 5).delayElements(Duration.ofSeconds(1));
        // Flux<Integer> just2 = Flux.just(10, 20, 30, 40, 50);
        // Flux<Integer> just3 = Flux.just(100, 200, 300, 400, 500);
        // Flux.concat(just1,just2,just3).subscribe(System.out::println);
        //
        // TimeUnit.SECONDS.sleep(Integer.MAX_VALUE );

        Flux<Integer> just1 = Flux.just(1, 2, 3, 4, 5).delayElements(Duration.ofSeconds(1));
        Flux<Integer> just2 = Flux.just(10, 20, 30, 40, 50);
        Flux<Integer> just3 = Flux.just(100, 200, 300, 400, 500);

        Flux.merge(just1,just2,just3).subscribe(System.out::println);
        TimeUnit.SECONDS.sleep( Integer.MAX_VALUE );
    }

}
